package models;

import play.db.jpa.GenericModel;
import play.db.jpa.Model;
import play.data.validation.Required;
import play.data.validation.MaxSize;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;


/**
 * Model Departamento generated by Play!
 */

@Entity
@Table(name="DEPARTAMENTO")
public class Departamento extends GenericModel {

	@Id
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="SEQ_DEPARTAMENTO")
	@SequenceGenerator(name="SEQ_DEPARTAMENTO", sequenceName="SEQ_DEPARTAMENTO", allocationSize=1)
	private long iddepartamento;
    @Required
    @ManyToOne
    public Escuela escuela;
    @Required
    @MaxSize(30)
    public String nombredepartamento;
    //@OneToMany(mappedBy="DEPARTAMENTO")  
    //public Set<DocenteDirige> docenteDiriges = new HashSet<DocenteDirige>(0);
    //@OneToMany(mappedBy="DEPARTAMENTO")  
    //public Set<Docente> docentes = new HashSet<Docente>(0);
    //@OneToMany(mappedBy="DEPARTAMENTO")  
    //public Set<Asignatura> asignaturas = new HashSet<Asignatura>(0);

    //default constructor 
    public Departamento() {
    }
    public Departamento(long iddepartamento) {
     	this.iddepartamento = iddepartamento;
    }
   


}


